<!--#include file="../Include/Conn.asp" -->
<!--#include file="../Include/function.asp" -->
<!--#include file="seeion.asp"-->
<%
dim action : action=getForm("action","get")
Select case action	
	case "edit" :editSort	
End Select

dim SortID, ParentID, px_id, SortType, SortName, SortURL, SortLevel, AddTime, PageTitle, PageKeywords, PageDesc, SortPath, isok, TopSortID, GroupID, Exclusive, Content
dim sql, msg

Sub getSort
	dim id : id=getForm("id","get")
	if not isnul(ID) then	
		set rs=server.createobject("adodb.recordset") 
        exec="select * from zych_Type where SortID="&ID
        rs.open exec,conn,1,1	
		if rs.eof then 
			alertMsgAndGo "没有这条记录","-1"
		else
			SortID=rs("SortID")
			ParentID=rs("ParentID")
			px_id=rs("px_id")
			SortType=rs("SortType")
			SortName=rs("SortName")
			SortURL=rs("SortURL")
			SortLevel=rs("SortLevel")
			AddTime=rs("AddTime")
			PageTitle=rs("PageTitle")
			PageKeywords=rs("PageKeywords")
			PageDesc=rs("PageDesc")
			SortPath=rs("SortPath")
			isok=rs("isok")
			TopSortID=rs("TopSortID")
			Content=rs("SortContent")
		end if
		rs.close : set rs=nothing
	else		
		alertMsgAndGo "没有这条记录","-1"
	end if 
End Sub

Sub editSort	
	SortID=getForm("SortID", "post")
	SortName=getForm("SortName", "post")
	PageTitle=getForm("PageTitle", "post")
	PageKeywords=getForm("PageKeywords", "post")
	PageDesc=getForm("PageDesc", "post")	
	isok=getForm("isok", "post")
	Content=Trim(Request.Form("Content"))
	if isnul(SortName) then alertMsgAndGo "分类名称不能为空","-1"	
	conn.execute "update zych_Type set SortName='"&SortName&"', PageTitle='"&PageTitle&"', PageKeywords='"&PageKeywords&"', PageDesc='"&PageDesc&"', SortContent='"&Content&"' where SortID="&SortID, "exe"	
	alertMsgAndGo "修改成功","admin_About.asp"
End Sub
%>